open(FH,"</Users/yaping/Documents/workspace/gatk_read/Sting/resources/Homo_sapiens_assembly18.fasta");
my @in=<FH>;
#chomp(@in);
close(FH);
my @out;
my $falg=0;
foreach my $line(@in){
	if($line=~/\>chr\S+_random/){
		$falg=1;
		print("$line\n");
	}
	elsif($line=~/\>chr\S+/){
		$falg=0;
		print("$line\n");
	}
	next if $falg == 1;

	push(@out,$line);
}
open(OUT,">Homo_sapiens_assembly18_without_random.fasta");
print OUT @out;
close(OUT);

system("/Users/yaping/software/samtools-0.1.12a/samtools faidx /Users/yaping/Documents/workspace/gatk_read/Sting/resources/Homo_sapiens_assembly18_without_random.fasta");